package Linked;

import java.io.*;
import java.util.Scanner;

public class LinkedTest_Maru  {
    public static int nMaru=0;
    public static void main(String[] args)  throws IOException{
        Scanner sc=new Scanner(System.in);
        LinkedStack list=new LinkedStack();
        list.getInt(nMaru);
        nMaru++;
        System.out.println("please input your number and today's time");
        String sz=sc.nextLine();
        list.add(sz);
        System.out.println("if you want to stop,you can input 'end'");
        while(!sz.equals("end")){
            sz = sc.nextLine();
            if (sz.equals("end")){
                break;
            }
            list.add(sz);
            nMaru++;
        }
        list.getInt(nMaru);
        System.out.println("you own "+nMaru+" elements");
        System.out.println(list);
        File file =new File("C:/java", "data.txt");
        if(!file.exists()){
                file.createNewFile();
            }
        Reader reader=new FileReader(file);
        BufferedReader br=new BufferedReader(reader);
        String content= br.readLine();
        String[] ss=content.split(" ",2);
        String one=ss[0];
        String two=ss[1];
        list.add(one,4);
        nMaru++;
        list.add(two,0);
        nMaru++;
        list.getInt(nMaru);
        System.out.println("you own "+nMaru+" elements");
        System.out.println(list);

        list.delete(5);
        nMaru--;
        list.getInt(nMaru);
        System.out.println("you own "+nMaru+" elements");
        System.out.println(list);

        list.getInt(nMaru);
        list.maopaoCompareUp(nMaru);
        System.out.println("20202321maopaopaixu,small to big");
        System.out.println(list);

        }
}




